Optimal. Leaf size=19 \[ a x-b x+\frac {b \tan (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.01, antiderivative size = 19, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3554, 8}
\begin {gather*} a x+\frac {b \tan (c+d x)}{d}-b x \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3554
Rubi steps
\begin {align*} \int \left (a+b \tan ^2(c+d x)\right ) \, dx &=a x+b \int \tan ^2(c+d x) \, dx\\ &=a x+\frac {b \tan (c+d x)}{d}-b \int 1 \, dx\\ &=a x-b x+\frac {b \tan (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.01, size = 28, normalized size = 1.47 \begin {gather*} a x-\frac {b \text {ArcTan}(\tan (c+d x))}{d}+\frac {b \tan (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.02, size = 29, normalized size = 1.53
method | result | size |
norman | \(\left (a -b \right ) x +\frac {b \tan \left (d x +c \right )}{d}\) | \(20\) |
derivativedivides | \(\frac {b \tan \left (d x +c \right )+\left (a -b \right ) \arctan \left (\tan \left (d x +c \right )\right )}{d}\) | \(27\) |
default | \(a x +\frac {b \tan \left (d x +c \right )}{d}-\frac {b \arctan \left (\tan \left (d x +c \right )\right )}{d}\) | \(29\) |
risch | \(a x -b x +\frac {2 i b}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}\) | \(29\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.50, size = 23, normalized size = 1.21 \begin {gather*} a x - \frac {{\left (d x + c - \tan \left (d x + c\right )\right )} b}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.34, size = 21, normalized size = 1.11 \begin {gather*} \frac {{\left (a - b\right )} d x + b \tan \left (d x + c\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.05, size = 20, normalized size = 1.05 \begin {gather*} a x + b \left (\begin {cases} - x + \frac {\tan {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \tan ^{2}{\left (c \right )} & \text {otherwise} \end {cases}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 231 vs.
\(2 (19) = 38\).
time = 0.53, size = 231, normalized size = 12.16 \begin {gather*} a x + \frac {{\left (\pi - 4 \, d x \tan \left (d x\right ) \tan \left (c\right ) - \pi \mathrm {sgn}\left (2 \, \tan \left (d x\right )^{2} \tan \left (c\right ) + 2 \, \tan \left (d x\right ) \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right ) - 2 \, \tan \left (c\right )\right ) \tan \left (d x\right ) \tan \left (c\right ) - \pi \tan \left (d x\right ) \tan \left (c\right ) + 2 \, \arctan \left (\frac {\tan \left (d x\right ) \tan \left (c\right ) - 1}{\tan \left (d x\right ) + \tan \left (c\right )}\right ) \tan \left (d x\right ) \tan \left (c\right ) + 2 \, \arctan \left (\frac {\tan \left (d x\right ) + \tan \left (c\right )}{\tan \left (d x\right ) \tan \left (c\right ) - 1}\right ) \tan \left (d x\right ) \tan \left (c\right ) + 4 \, d x + \pi \mathrm {sgn}\left (2 \, \tan \left (d x\right )^{2} \tan \left (c\right ) + 2 \, \tan \left (d x\right ) \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right ) - 2 \, \tan \left (c\right )\right ) - 2 \, \arctan \left (\frac {\tan \left (d x\right ) \tan \left (c\right ) - 1}{\tan \left (d x\right ) + \tan \left (c\right )}\right ) - 2 \, \arctan \left (\frac {\tan \left (d x\right ) + \tan \left (c\right )}{\tan \left (d x\right ) \tan \left (c\right ) - 1}\right ) - 4 \, \tan \left (d x\right ) - 4 \, \tan \left (c\right )\right )} b}{4 \, {\left (d \tan \left (d x\right ) \tan \left (c\right ) - d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 11.44, size = 21, normalized size = 1.11 \begin {gather*} \frac {b\,\mathrm {tan}\left (c+d\,x\right )+d\,x\,\left (a-b\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________